<!DOCTYPE html>
<html>
<head>
    <!--[if lt IE 7]>
    <div class="ie6_error">还在用<strong>漏洞百出的IE6浏览器</strong>么？为了您的网络安全，请升级浏览器 <a target="_blank"
                                                                               href="http://browsehappy.com">立即升级</a>
    </div>
    <![endif]-->

    <meta charset="utf-8">
    <title>购物车步骤1-文具1号</title>
    <meta name="description"
          content="文具1号作为上海办公用品供货商公司,专为世界500强企业及SOHO办公族提供网上商城一站式办公耗材批发及采购服务,一站式选购办公日用文具用品,厂家直销,好货又便宜【阳光采购就上文具1号 阳光价格 老板放心 品质保障 员工省力】"/>
    <meta name="keywords" content="办公用品,办公文具,办公文具网站,文具网站,办公用品网,文具采购网,金万年"/>
    <meta name="copyright" content="上海易推信息科技有限公司"/>
    <meta name="renderer" content="webkit">
    <!--<link rel="stylesheet" type="text/css" href="css/default.css"/>-->
    <base href="<?php echo base_url(); ?>"/>
    <link rel="stylesheet" href="public/js/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="public/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/cart.css?v=0.111156"/>
    <link rel="stylesheet" type="text/css" href="public/css/header.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/detail.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/sameproduct.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/popup.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/layer.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/new_add_css.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/newaddress.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/eProtocolBox.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/buyagain.css"/>
    <!--[if lte IE 9]>
    <script type="text/javascript" src="../public/js/html5shiv-printshiv-3.js"></script>
    <![endif]-->
    <script src="public/js/jquery.1.7.1-min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<?php $this->load->view('common/header.php'); ?>
<div class="bg">
    <div id="content" class="tpl-order">
        <div class="flowstep" id="J_Flowstep"
             style="background:url(public/images/navbg.jpg) no-repeat center center;    margin: 40px 0px;">
        </div>

        <h2>商品信息
            <span id="R_reConfirmTip" class="reconfirm-tip" style="visibility: visible; display: none;">更换地址后，您需要重新确认订单信息<s></s>
            </span>
        </h2>

        <div class="productlistTitleBox">
            <p class=""><a href="<?= $this->config->item("shop_url") ?>" title="文具1号超市" target="_blank">文具1号超市</a></p>
            <p style="margin-left: -40px;">单价（元）</p>
            <p style="margin-left: -60px;">数量</p>
            <p style="margin-left: 20px;">小计(元)</p>
            <p style="margin-left: 105px;">包裹</p>
        </div>
        <form id="J_orderForm" action="bBVerifyOrder-orderSum.html" method="post">
            <div id="J_orders" class="shine-list">
                <div class="bundle">

                    <table class="grid-bundle grid-bundle-B">
                        <thead>
                        </thead>
                        <tbody>
                        <tr class="grid-main">
                            <td colspan="5" class="tube-main">
                                <table>
                                    <tbody>
                                    <?php $count_not_in_range = 0;
                                    $freightprice = 0;
                                    $goodsprice = 0;
                                    $j = -1;
                                    $item = [];
                                    foreach ($result as $key => $value): ?>
                                        <?php $count_not_in_range += $value['count_not_in_range'];
                                        $freightprice += $value['postage'];
                                        $j += 1; ?>
                                        <?php if ($value['count_in_range'] != 0): ?>
                                            <?php $i = 0;
                                            foreach ($value['in_range_List'] as $k => $v): ?>
                                                <?php
                                                $i += 1;
                                                $goodsprice += $v['price'] * $v['quantity'];
                                                $row['product_id'] = $v['goods_id'];
                                                $row['number'] = $v['quantity'];
                                                $item[$j]['goodsinfo'][] = $row;
                                                $item[$j]['address_id'] = $value['address_id'];
                                                ?>
                                                <tr style="border-bottom: 1px dashed #ccc;">
                                                    <td class="tube-img"><a title="" class="img"
                                                                            href="<?php echo base_url() ?>/goods/detail?id=<?= $v['goods_id'] ?>"><img
                                                                    height="50" src="<?= $v['default_image'] ?>"></a>
                                                    </td>
                                                    <input type="hidden" name="recid[]" id="recid"
                                                           value="<?= $v['goods_id'] ?>">
                                                    <td class="tube-master" style="text-align: left;">
                                                        <p class="item-title"><a
                                                                    href="<?php echo base_url() ?>/goods/detail?id=<?= $v['goods_id'] ?>"><?= $v['goods_name'] ?></a>
                                                        </p>
                                                        <?php if (isset($v['sku_info']) && $v['sku_info'] != ""): ?>
                                                            <?php foreach ($v['sku_info'] as $l => $m): ?><p
                                                                    class="sku-line"><?= $l ?> : <a
                                                                    href="javascript:void(0);"><?= $m ?></a></p>
                                                            <?php endforeach; ?>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td class="tube-price"
                                                        style="margin-left: 15px;"><?= $v['price'] ?></td>
                                                    <td class="tube-amount"><?= $v['quantity'] ?></td>
                                                    <td class="tube-promo"><?php echo $v['price'] * $v['quantity'] ?></td>
                                                    <td style="border-right: 1px dashed #ccc;"></td>
                                                    <?php if ($i == 1): ?>
                                                        <td class="header-status"
                                                            rowspan="<?= count($value['in_range_List']) ?>">
                                                            <div style="text-align: left; padding-left: 10px;">
                                                                <p style="padding: 5px;">包裹<?php echo $j+1; ?>
                                                                    ：运费（<?= $value['postage'] ?>元）</p>
                                                                <p>
                                                                    <em style="padding: 5px;"><?= $value['name'] ?></em> <?= $value['phone'] ?>
                                                                </p>
                                                                <p class="tal"
                                                                   style="padding: 5px;"><?= $value['province'] ?><?= $value['city'] ?><?= $value['district'] ?><?= $value['address'] ?>
                                                                </p>
                                                            </div>
                                                        </td>
                                                    <?php endif; ?>
                                                </tr>
                                            <?php endforeach; ?>
                                        <?php endif; ?>
                                    <?php endforeach; ?>
                                    </tbody>
                                    <?php $item = json_encode($item) ?>
                                </table>
                            </td>
                        </tr>
                        </tbody>

                    </table>

                </div>
            </div>
            <div class="supplementaryInstruction">
                <div class="aa ovh">
                    <span class="a fl">补充说明:</span>
                    <input name="message" type="text" class="b fl" style="font-size: 12px;">
                    <p class="d fr">快递费: <span><?php echo $freightprice; ?></span>元</p>
                    <p class="d fr ywy_c">运送方式:<span>普通配送</span></p>
                </div>
                <p class="bb fr" style="margin-right: 40px;"><span class="a">(含邮费)</span>店铺合计:<span
                            class="b countstore"><?= $goodsprice + $freightprice ?></span></p>
            </div>

            <?php if ($count_not_in_range != 0): ?>
                <br>
                <div class="notSendText">抱歉，以下商品在收货地址内不可售，请重选收货地址或提交订单结算以上商品</div><br>
                <div class="productlistTitleBox">
                    <p class="tube-title">
            <span class="title-wrap">
                <span class="bundle-title-a">
                    <a data-mm="" href="<?php echo base_url('office'); ?>" title="" target="_blank">文具1号超市 </a>
                </span>
            </span>
                    </p>
                    <p style="margin-left:150px;">单价（元）</p>
                    <p style="margin-left:50px;">数量</p>

                    <p style="margin-left:50px;">小计(元)</p>
                </div>
                <div class="bundle" style="margin-bottom: 23px;background-color:rgba(255, 242, 242, 1);border:none;">
                    <table class="grid-bundle grid-bundle-B">
                        <thead>
                        </thead>
                        <tbody>
                        <tr class="grid-main">
                            <td colspan="5" class="tube-main">
                                <table>
                                    <tbody>
                                    <?php foreach ($result as $key => $value): ?>
                                        <?php if ($value['count_not_in_range'] != 0): ?>
                                            <?php $i = 0;
                                            foreach ($value['not_in_range_List'] as $k => $v): ?>
                                                <?php $i += 1; ?>
                                                <tr style="border-bottom: 1px dashed #ccc;">
                                                    <td class="tube-img"><a title="" class="img"
                                                                            href="<?php echo base_url() ?>/goods/detail?id=<?= $v['goods_id'] ?>"><img
                                                                    height="50" src="<?= $v['default_image'] ?>"></a>
                                                    </td>
                                                    <td class="tube-master" style="text-align: left;">
                                                        <p class="item-title"><a
                                                                    href="<?php echo base_url() ?>/goods/detail?id=<?= $v['goods_id'] ?>"><?= $v['goods_name'] ?></a>
                                                        </p>
                                                        <?php if (isset($v['sku_info']) && $v['sku_info'] != ""): ?>
                                                            <?php foreach ($v['sku_info'] as $l => $m): ?><p
                                                                    class="sku-line"><?= $l ?> : <a
                                                                    href="javascript:void(0);"><?= $m ?></a></p>
                                                            <?php endforeach; ?>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td class="tube-price"
                                                        style="margin-left: 15px;"><?= $v['price'] ?></td>
                                                    <td class="tube-amount"><?= $v['quantity'] ?></td>
                                                    <td class="tube-promo"><?php echo $v['price'] * $v['quantity'] ?></td>
                                                    <td style="border-right: 1px dashed #ccc;"></td>
                                                    <?php if ($i == 1): ?>
                                                        <td class="header-status"
                                                            rowspan="<?= count($value['in_range_List']) ?>">
                                                            <div style="text-align: left; padding-left: 10px;">
                                                                <p style="padding: 5px;">包裹一：运费（<?= $value['postage'] ?>
                                                                    元）</p>
                                                                <p>
                                                                    <em style="padding: 5px;"><?= $value['name'] ?></em> <?= $value['phone'] ?>
                                                                </p>
                                                                <p class="tal"
                                                                   style="padding: 5px;"><?= $value['province'] ?><?= $value['city'] ?><?= $value['district'] ?><?= $value['address'] ?>
                                                                </p>
                                                            </div>
                                                        </td>
                                                    <?php endif; ?>
                                                </tr>
                                            <?php endforeach; ?>
                                        <?php endif; ?>
                                    <?php endforeach; ?>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                        </tbody>

                    </table>
                </div>
            <?php endif; ?>

            <h2 class="font-left" style="border-top: 1px dashed #ccc;padding-top: 10px; margin-top:30px;">确认发票信息</h2>
            <p class="font-left" style="border-bottom:1px dashed #ccc;padding-bottom:10px;">
                <span class="labs">暂不需要</span>

                <span id="selectInvoice">修改</span>
            </p>
            <h2 class="font-left" style="padding-top: 10px;">选择成本中心<em style="font-size:12px; color:#2b2d2e;">（将便于您对企业账户的数据统计与管理）</em>
            </h2>
            <p class="font-left" style="padding-bottom:10px;">
                <span class="labss">成本中心：</span>
                <select name="bm" id="" class="selectInvoice-section">
                    <?php foreach ($cost_center as $value): ?>
                        <option value="<?= $value['id'] ?>"><?= $value['name'] ?></option>
                    <?php endforeach; ?>
                </select>
                <a target="_blank" href="<?php echo base_url('cost_center/create_cost_center_index'); ?>"
                   class="selectInvoice-section-add"></a>
            </p>


            <div id="J_checkbar" class="checkbar" style="display: block;">
                <!--进度条模式-->
                <div class="main" style="padding:5px 0;position: relative; background-color: #f4f4f4;">
                    <div class="due">
                        <p class="pay-info">
                            (含邮费)
                            <span class="hd" style="font-size: 16px;">实付款：</span>
                            <span class="bd" style="color: #333;">
                        <span class="tc-rmb">¥</span>
                        <strong data-pre="<?= $goodsprice + $freightprice ?>"
                                id="J_ActualPaid"><?= $goodsprice + $freightprice ?></strong>
                    </span>
                            <button class="go-btn" type="button" title="提交订单" onclick="order();"
                                    style="background: #c40000;color: white;text-indent: 0;font-size: 16px;">提交订单
                            </button>
                        </p>
                    </div>
                </div>

                <strong id="J_Discharge" style="display: none">0.00</strong>
                <input type="hidden" name="invoice_id" value="0">
                <input type="hidden" name="type" value="0">
                <input type="hidden" name="invoice_cont" value="">
                <input type="hidden" name="uid" value="<?= $customer_id ?>">
                <input type="hidden" id="remark" name="remark" value="">
            </div>
        </form>

    </div>
    <?php $this->load->view('common/bottom.php'); ?>
</div>
<div class="mask none"></div>

<div class="pop pop-account-activation bg-padding-inside none part-failure-window" style="height:253px;">
    <a href="javascript:;" class="close bg-btn_close_n"></a>
    <p class="top-tit">
        <span class="bg-logo_popup"></span>
    </p>
    <div class="cont" style="padding-top:55px;">
        <p class="intro">
            您添加的地址1255,25011 生成订单失败!
        </p>
        <div class="btn-box" style="padding-top:20px;">
            <a href="javascript:;" class="btn-submit go-settlement" style="width: 180px;">去结算已生成的订单</a>
        </div>
    </div>
</div>

<div class="pop pop-account-activation bg-padding-inside none all-failure-window" style="height:253px;">
    <a href="javascript:;" class="close bg-btn_close_n"></a>
    <p class="top-tit">
        <span class="bg-logo_popup"></span>
    </p>
    <div class="cont" style="padding-top:55px;">
        <p class="intro">
            您添加的所有地址生成订单失败!
        </p>
        <div class="btn-box" style="padding-top:20px;">
            <a href="javascript:;" class="btn-submit back-modify" style="width: 180px;">返回修改重新上传</a>
        </div>
    </div>
</div>
<!--修改发票弹框-->
<div id="layui-layer222" class="layui-layer1-class"
     style="z-index: 99999999; width: 750px; height: auto;text-align: center; display: none;margin-left: -300px; ">
    <div class="layui-layer-content">
        <div class="popup_content_bill pb22 dn layui-layer-wrap" style="display: block;">
            <p class="red fs15 strong mb8 w510 center tal">发票信息</p>
            <div class="w400 center" style="width:550px">
                <div class="ovh mb33" id="j_bill">
                    <span class="fl w120 h35 saveF_bg  fapiao mr20 fs15 strong curp" key="0"
                          style="margin-left: 10px;margin-right: 10px">暂不需要</span>
                    <span class="fl w120 h35 saveF_bg  fapiao mr20 fs15 strong curp" key="4" style="margin-right: 10px">企业普通发票</span>
                    <span class="fl w120 h35 saveF_bg  fapiao mr20 fs15 strong curp" key="2" style="margin-right: 10px">增值税专用发票</span>
                </div>

                <ul class="ul-content" style="margin-left: 20px;padding-left: 5px;">
                    <li class="">
                    </li>
                    <li>
                        <p><span>发票抬头：</span><input type="text" name="title4" value=""></p>
                        <div class="qyptdm">
                            <div class="qyptdm-f"><span class="qyptdm-m">*</span><span
                                        class="qyptdm-t" style="width: 100px;">纳税人识别号或统一社会信用代码：</span>
                            </div>
                            <input type="text" name="qycode" value="" style="float:left;"/>
                        </div>

                        <dl class="pop-dl d4">

                            <dt>发票内容：</dt>
                            <dd key="2" class="active">办公用品</dd>
                            <dd key="3">电脑配件</dd>
                            <dd key="4">耗材</dd>
                            <dd key="1">明细</dd>
                            <dd key="5">学习用品</dd>
                            <dd key="6">文具用品</dd>
                            <dd key="7">自定义</dd>
                        </dl>
                    </li>
                    <li class="active">
                        <p class="lab"><span>1、填写公司信息</span></p>
                        <p class="iput"><span><font color="red">*</font>单位名称：</span><input type="text" name="company"
                                                                                           value="">
                        </p>
                        <p class="iput"><span><font color="red">*</font>纳税人识别码：</span><input type="text" name="texpayer"
                                                                                             value="">
                        </p>
                        <p class="iput"><span><font color="red">*</font>注册地址：</span><input type="text" name="address"
                                                                                           value="">
                        </p>
                        <p class="iput"><span><font color="red">*</font>注册电话：</span><input type="text" name="tel"
                                                                                           value="">
                        </p>
                        <p class="iput"><span><font color="red">*</font>开户银行：</span><input type="text" name="bank"
                                                                                           value="">
                        </p>
                        <p class="iput"><span><font color="red">*</font>银行账户：</span><input type="text" name="card"
                                                                                           value="">
                        </p>
                        <p class="lab"><span>2、选择发票内容</span>
                        </p>
                        <dl class="pop-dl d2">
                            <dt>发票内容：</dt>
                            <dd key="1" class="active">明细</dd>
                            <dd key="2" style="display: none;">办公用品</dd>
                            <dd key="3" style="display: none;">电脑配件</dd>
                            <dd key="4" style="display: none;">耗材</dd>
                        </dl>
                    </li>
                </ul>
                <div class="ovh w230 center">
                    <div class="mr20 fl">
                        <input type="submit" class="iSubmit w115 h29 iSaveF" value="">
                    </div>
                    <div class="fl">
                        <input type="button" class="iSubmit w95 h29 iClose" value="">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a class="layui-layer-ico layui-layer-close layui-layer-close1" href="javascript:;"></a>
</div>

<?php
$url = $this->config->item("shop_url") . 'companymanagerapi/company_logout/';
$check_url = $this->config->item("shop_url") . 'companymanagerapi/user_status/';
$data_arr['time'] = time();
$data_arr['key'] = md5($this->config->item("token_const_wjyh") . $data_arr['time']);
?>
<script type="text/javascript">
    $('#selectInvoice').click(function () {
        $("#layui-layer222").css('display', 'block');
    })
    var flag = true;

    function order() {
        var regionId = $.trim($('input[name=regionId]').val());
        var recid = $("#recid").val();

        if (recid == undefined) {
            alert('请选择商品');
            return false;
        }


//判断商城站是否登录
        if (flag == false) {
            return false;
        }
        flag = false;
        $.ajax({
            type: "get",
            dataType: "jsonp",
            url: "<?php echo $check_url;?>",
            data: {'time': '<?php echo $data_arr['time'];?>', 'key': '<?php echo $data_arr['key'];?>'},
            jsonp: 'callback',
            async: false,
            jsonpCallback: "abc2",
            success: function (data) {

            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                console.log('someting is wrong')
            }
        });
    }

    function abc2(data) {
        var item = '<?=$item?>';
        var invoice_id = $("input[name=invoice_id]").val();
        var type = $("input[name=type]").val();
        var invoice_cont = $("input[name=invoice_cont]").val();
        var cost_center_id = $("select[name=bm]").val();
        //小tips

        var index = layer.load(1, {
            content: '<img src="public/images/wait-moment2.gif">', shade: 0.4, success: function (layero) {
            }
        })


        if (data['code'] == 200) {
            $.ajax({
                type: "post",
                dataType: "json",
                url: "multiple_address/create",
                data: {
                    item: item,
                    invoice_id: invoice_id,
                    type: type,
                    invoice_cont: invoice_cont,
                    cost_center_id: cost_center_id
                },
                success: function (data) {
                    if (data.code == -2) {
                        layer.close(index);
                        $('.all-failure-window').removeClass('none');
                        $('.all-failure-window').show();
                        $('.mask').removeClass('none');
                        $('.mask').show();
                    } else if (data.code == -1) {
                        layer.close(index);
                        $('.go-settlement').attr('url', data.url)
                        $('.part-failure-window .intro').html('您添加的地址' + data.data + ' 生成订单失败!');
                        $('.part-failure-window').removeClass('none');
                        $('.part-failure-window').show();
                        $('.mask').removeClass('none');

                    } else {
                        layer.close(index);
                        location.href = data.url;
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    console.log('someting is wrong')
                }
            });
        } else {
            console.log('no');
            window.location.href = '<?php echo $this->config->item("shop_url");?>mMLogin.html';
        }
    }

    $('.bg-btn_close_n').click(function () {
        $('.pop-account-activation').addClass('none');
        $('.pop-account-activation').hide();
        $('.mask').addClass('none');
        $('.mask').hide();
    })
    $('.go-settlement').click(function () {
        var url = $(this).attr('url');
        location.href = url;
    })
    $('.back-modify').click(function () {
        location.href = "<?php echo base_url();?>multiple_address";
    })
</script>


<!-- <script type="text/javascript" src="public/js/layer.js?v=1523346815"></script> -->
<script type="text/javascript" src="public/js/layerUtils.js?v=1523346815"></script>
<script type="text/javascript" src="public/js/buyer_cart.js?v=1523346825"></script>
<script type="text/javascript" src="public/js/buyNew.js?v=<?php echo time(); ?>"></script>
<script type="text/javascript" src="public/js/purchase.js?v=1523346855"></script>
<script type="text/javascript" src="public/js/progress.js?v=1523346815"></script>
<script type="text/javascript" src="public/js/cart_timeover.js?v=1523346815"></script>
<script src="public/js/jquery.imageScroller.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/jquery.imagezoom.min.js" type="text/javascript" charset="utf-8"></script>
<script src="public/js/detail.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="public/js/distpicker/distpicker.data.js "></script>
<script type="text/javascript" src="public/js/distpicker/distpicker.js"></script>
<style type="text/css">
    #layui-layer222 {
        margin-left: -300px !important;
    }

    .ul-content li {
        text-align: left;
    }

    .layui-layer-loading1{
    font-size:16px;
    padding-right:30px;
    margin-top:-70px;
    width:300px !important;
    color: #dc143c;
    /*left: 180px;*/
    /*top: 200px;*/
  }
</style>
</body>
</html>